//
//  GPoint.cpp
//  dot
//
//  Created by zz on 2019/6/20.
//

#include "GPoint.hpp"

GPoint* GPoint::create(Vec2 pos){
    
    auto p = new GPoint();
    if(p&&p->init(pos)){
        
        p->autorelease();
        return p;
    }else{
    
        CC_SAFE_DELETE(p);
        return NULL;
    }
    
    
}
bool GPoint::init(Vec2 pos){
    
    this->initWithFile("Dot2.png");
    this->setPosition(pos);
    this->r = this->getContentSize().width/2;

    return true;
}

void GPoint::toFadeOut(){
    
    auto fa = FadeOut::create(1.0f);
    auto call = RemoveSelf::create();
    auto seq = Sequence::create(fa,call, NULL);
    this->runAction(fa);
}

float GPoint::getR(){
    
    return this->r;
}


